package net.towee.client.managers;

import net.towee.model.repo.AttachmentIdentity;
import net.towee.model.repo.AttachmentInfo;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Manage attachments info. Get and cache it.
 * 
 * <ul>The implementation MUST handler this PUSH events:
 * <li>Some attachment downloaded - {@link AttachmentDownloadedEvent}</li>
 * </ul>
 * 
 * @author c58
 */
public interface AttachmentsManager {
	/**
	 * Get extended info about attachment with given id
	 * 
	 * @param attachmentId
	 */
	void getAttachmentInfo(String attachmentId, AsyncCallback<AttachmentInfo> handler);
	
	/**
	 * Create attachment identity by raw id attachment. This id you may get as response
	 * after successfully upload file.
	 * 
	 * When this method called for given id, this id removing from user session
	 * as used attachment. All unused attachments will removed after and of session.
	 * 
	 * @param rawAttachmentId
	 */
	void createAttachmentIdentity(String rawAttachmentId, AsyncCallback<AttachmentIdentity> handler);
}
